package cn.doit.scala.day05.high_function

/**
 * @DATE 2021/12/30/11:17
 * @Author MDK
 * @Version 2021.2.2
 * */
object C01_高阶函数03 {
  def mkURL(ssl:Boolean, domain:String)={
    var port = "http"
    if(ssl){
      port="https"
    }
    val key=s"$port://$domain"
    (k:String, v:String)=>s"$key?$k=$v"
  }

  def main(args: Array[String]): Unit = {
    val str: String = mkURL(true,"www.doit.com.cn")("username","zss")
    println(str)
  }
}
